package com.demo.swingquickticket.util.redis;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import javax.annotation.Resource;

@Configuration
public class RedisConfig {

    @Resource
    private RedisTemplate<String, Object> redisTemplate;

    @Value("${my.cache.redis.prefix}")
    private String prefix;

    @Bean(name = "cacheUtil")
    public CacheUtil getCacheUtil() {
        return new RedisCacheImpl(redisTemplate, prefix);
    }
}
